import 'package:json_annotation/json_annotation.dart';

part 'data.g.dart';

@JsonSerializable()
class JtList {
  int code;
  List<JtListDatum> data;
  String msg;

  JtList({
    this.code,
    this.data,
    this.msg,
  });

  //反序列化
  factory JtList.fromJson(Map<String, dynamic> json) => _$JtListFromJson(json);

  //序列化
  Map<String, dynamic> toJson() => _$JtListToJson(this);
}

@JsonSerializable()
class JtListDatum {
  int id; //機台id
  String name;
  int money;
  int isonline;
  int auto_switch;
  int order;
  int shunyi;

  JtListDatum({
    this.id,
    this.name,
    this.money,
    this.isonline,
    this.auto_switch,
    this.order,
    this.shunyi,
  });

  //反序列化
  factory JtListDatum.fromJson(Map<String, dynamic> json) =>
      _$JtListDatumFromJson(json);

  //序列化
  Map<String, dynamic> toJson() => _$JtListDatumToJson(this);
}
